<?php
App::import('Model','Config.BaseConfig');
class EmailConfig extends BaseConfig
{
	var $name = 'EmailConfig';
	var $cache = "+5 minutes";
	var $actsAs = array('Config.StartupConfig');
	
	var $validate = array(
						'port'=>array(
							'rule'=>array('numeric'),
							'message'=>'Enter a numeric value'
							),
						'timeout'=>array(
							'rule'=>array('numeric'),
							'message'=>'Enter a numeric value'
							)
						);
						
	function initialize()
	{
		$this->fieldProperties = array(
							'type'=>array(
									'type'=>'select',
									'label' => __("Type of Mailing system to be used"),
									'options'=>array('mail'=>__('Mail(PHP internal mail functionality)'),
													'smtp'=>__('SMTP server')),
									'group'=>'add'
									),
							'port'=>array(
									'label'=>__("Port"),
									'type'=>'text',
									'group'=>'add',
									'default'=>25,
									'class'=>'toggleField'
									),
							'host'=>array(
									'label'=>__("Host"),
									'type'=>'text',
									'group'=>'add',
									'default'=>'localhost',
									'class'=>'toggleField'
									),
							'protocol' => array(
								'label' => __("Protocol"),
								'type'=>"select",
								'group' => "add",
								'options' => array("smtp"=>"smtp","tls"=>"tls","ssl"=>"ssl"),
								'class'=>'toggleField'	
							),
							'timeout'=>array(
									'label' => __("Timeout"),
									'type'=>'text',
									'group'=>'add',
									'default'=>30,
									'class'=>'toggleField'
									),
							'username'=>array(
									'label' => __("Username"),
									'type'=>'text',
									'group'=>'add',
									'class'=>'toggleField'									
									),
							'password'=>array(
									'label' => __("Password"),
									'type'=>'text',
									'group'=>'add',
									'class'=>'toggleField'
									)
							);
		parent::initialize();
	}
									
}

?>